﻿@{
    ViewBag.Title = "修改邮箱";
    Layout = "~/Views/Shared/_MemberLayout.cshtml";
}


<div id="Content_Panel1"  style="width:100%;">
    <form id="submitForm">
        <div style="padding-top: 10px; width: 100%">
            <div id="Content_div1">
                @*<div style="background-color: #fef6a9; line-height: 25px; padding: 10px 10px; margin-bottom: 0px;">
                    为确保您新的邮件地址真实可用，您修改邮件地址时，我们会向您新的邮件地址发送一封激活邮件，您收到邮件激活后方能修改成功。
                </div>*@
                <ul class="fl person-data-set pt30 pb30">
                    <li class="works-edit-item clearfix formValue">
                        <label class="fl person-data-label">
                            登录密码：
                        </label>
                        <input name="password" type="password" id="password" class="fl bag-item-input mr5 J-member-nickname required" style="width:196px;" />
                    </li>
                    <li class="works-edit-item clearfix formValue">
                        <label class="fl person-data-label">
                            邮箱地址：
                        </label>
                        <input name="Email" type="text" id="Email" class="fl bag-item-input mr5 J-member-nickname required email" style="width:196px;" />
                    </li>
                    <li class="works-edit-item clearfix formValue">
                        <label class="fl person-data-label">
                            确认邮件：
                        </label>
                        <input name="ConEmail" type="text" id="ConEmail" class="fl bag-item-input mr5 J-member-nickname required email" style="width:196px;" />
                    </li>
                    <li class="works-edit-item clearfix formValue">
                        <label class="fl person-data-label">
                            验证码：
                        </label>
                        <input name="VerifyCode" type="text" id="VerifyCode" class="fl bag-item-input mr5 J-member-nickname required" name="loginpwd" style="width: 60px;" />&nbsp;
                        <img src="/SysComponent/Controll/GetAuthCode" id="imgcode" align="absmiddle" style="border: solid 1px #efefef;
                                height: 30px; width: 80px;" />
                        <a id="switchCode" style="text-decoration:underline;">看不清？换一个</a>
                        &nbsp;<span id="Content_RequiredFieldValidator5" style="color:#FF1100;display:none;">请输入验证字符!</span>
                    </li>
                    <li class="works-edit-item clearfix">
                        <label class="fl person-data-label">
                            &nbsp;
                        </label>
                        <input type="button" name="btnSubmit" value="" id="btnSubmit" class="member-common-btn member-common-btn2" />
                    </li>
                </ul>
            </div>

        </div>
    </form>
</div>
@section Scripts{
    <script src="/js/dialog/dialog.js"></script>
    <script src="/js/framework-ui.js"></script>
    <script src="/js/validate/jquery.validate.min.js"></script>

    <script type="text/javascript">
        $(function () {
            $("#submitForm").validate({
                rules: {
                    Email: "required",
                    ConEmail: {
                        equalTo: "#Email"
                    }
                }
            });


            $("#switchCode").click(function () {
                $("#imgcode").attr("src", "/SysComponent/Controll/GetAuthCode?time=" + Math.random());
            });
            
            $("#btnSubmit").click(function () {
                    var $form = $('#submitForm');
                    if (!$form.IsValid()) {
                        return false;
                    }
                $.submitDialog({
                        url: "/Member/ChangeEmail",
                        param: $form.formSerialize(),
                        success: function () {
                            $.modalAlertReload("提交成功！", "success");
                        }
                    });
                });

            });
    </script>

}